import {createStackNavigator} from 'react-navigation-stack';
import {createBottomTabNavigator} from 'react-navigation-tabs';
import {createAppContainer} from 'react-navigation';
import Home from './Home';
import Friends from './Friends';
import Counter from './Counter';

const AppStackNavigator = createBottomTabNavigator(
  {
    Home: {
      screen: Home,
    },
    Friends: {
      screen: Friends,
    },
    Counter: {
      screen: Counter,
    },
  },
  {
    initialRouteName: 'Home',
    /* 这里定义的头部样式对栈中的每个屏幕生效除非那个屏幕类覆盖了改定义 */
    navigationOptions: {
      headerStyle: {
        backgroundColor: '#f4511e',
      },
      headerTintColor: '#fff',
      headerTitleStyle: {
        fontWeight: 'bold',
      },
    },
  },
);

const Apps = createAppContainer(AppStackNavigator);

export default Apps;
